home *** CD-ROM | disk | FTP | other *** search
/ MacFormat 1994 August / August CD.bin / Shareware / Programming / Infinity Windoid WDEF 2.6 / WindoidTypes.h < prev    next >
Encoding:
Text File  |  1994-04-01  |  4.9 KB  |  160 lines  |  [TEXT/MPS ]

  1. // *****************************************************************************
  2. //
  3. //    WindoidTypes.h
  4. //
  5. // *****************************************************************************
  6. #ifndef __WindoidTypes__
  7. #define __WindoidTypes__
  8.  
  9. // -----------------------------------------------------------------------------
  10. #ifndef __WindoidDefines__
  11. #include <WindoidDefines.h>
  12. #endif
  13.  
  14. #ifndef __TYPES__
  15. #include <Types.h>
  16. #endif
  17.  
  18. #ifndef __WINDOWS__
  19. #include <Windows.h>
  20. #endif
  21.  
  22. // *****************************************************************************
  23. //    Constants
  24. // -----------------------------------------------------------------------------
  25. //    Titlebar and gadget sizes and offsets
  26.  
  27. #ifdef THICK_TITLEBAR
  28.  
  29.     #define    kTitleHeight    13        // height of the windoid's titlebar.
  30.     #define kTingeInset         1        // when insetting to adjust for window sides
  31.     
  32.     #define kGadgetInset     3        // inset from top/bottom of titlebar 
  33.                                     //    (with titlebar on top of window)
  34.     #define kGadgetMargin     8        // space between edge and gadget
  35.     #define kGadgetSize        (kTitleHeight - (2 * kGadgetInset))
  36.  
  37.     #define kTitleVDelta     2        // how far up from bottom of titlebar the
  38.                                     // the baseline of the text is located
  39. #else
  40.  
  41.     #define    kTitleHeight    11        // height of the windoid's titlebar.
  42.     #define kTingeInset         0        // when insetting to adjust for window sides
  43.     
  44.     #define kGadgetInset     2        // inset from top/bottom of titlebar 
  45.                                     //    (with titlebar on top of window)
  46.     #define kGadgetMargin     6        // space between edge and gadget
  47.     #define kGadgetSize        (kTitleHeight - (2 * kGadgetInset))
  48.  
  49.     #define kTitleVDelta     1        // how far up from bottom of titlebar the
  50.                                     // the baseline of the text is located
  51. #endif
  52.  
  53.     #define kGadgetHitFudge     1
  54.     
  55. // -----------------------------------------------------------------------------
  56. //    Scroll Bar width
  57.  
  58. #ifndef SMALL_GROW
  59.     #define kScrollBarPixels    16
  60. #else
  61.     #define kScrollBarPixels    13
  62. #endif
  63.  
  64. // -----------------------------------------------------------------------------
  65. //    Font information for titlebar title
  66.  
  67. #define kTitleFont            applFont
  68. #define kTitleSize            9
  69. #define kTitleStyle            bold
  70.  
  71. #define kTitleMargin        5        // space between pattern and edges of text    
  72.  
  73. // -----------------------------------------------------------------------------
  74. //    Color table tinge percentage constants    
  75.  
  76. #define    wTitleBarLightPct        0x1
  77. #define    wTitleBarDarkPct        0x8
  78. #define wTitleBarTingeDarkPct    0x4
  79.  
  80. #define wCloseBoxColor            0x5
  81.  
  82. #define wGrowBoxBackground        0x1
  83. #define wGrowBoxColorLt            0x4
  84. #define wGrowBoxColorDk            0x5
  85.  
  86. #define    wXedBoxPct                0x8
  87. #define    wInactiveFramePct        0xA
  88. #define    wInactiveTextPct        0x7
  89.  
  90. // -----------------------------------------------------------------------------
  91. //    Color table constants    
  92.  
  93. enum {
  94.     wHiliteColorLight = 5, 
  95.     wHiliteColorDark,
  96.     wTitleBarLight,
  97.     wTitleBarDark,
  98.     wDialogLight,
  99.     wDialogDark,
  100.     wTingeLight,
  101.     wTingeDark
  102. };
  103.     // These are the constants defined in the Apple technical note regarding
  104.     // Color, Windows, and System 7. Last I checked, they weren't in an Apple
  105.     // header file. (But the ones < 5 are, from the previous, pre-System 7
  106.     // coloring scheme.)
  107.  
  108. // -----------------------------------------------------------------------------
  109. //    Style variation constants    
  110. // -----------------------------------------------------------------------------
  111.  
  112. enum {
  113.     blackandwhite = 0,
  114. #ifndef SYS7_OR_LATER
  115.     sys6color,
  116. #endif
  117.     sys7color
  118. };
  119.     // These constants represent the three types of window 'colorings' we
  120.     // support.
  121.     
  122. // -----------------------------------------------------------------------------
  123. //    MacApp style variations    
  124. // -----------------------------------------------------------------------------
  125.  
  126. #define kMacApp_toggleTBar    1    // bit 0 tells us whether to hilite/unhilite 
  127.                                 //       title bar
  128. #define kMacApp_hasTallTBar    2    // bit 1 is tall title bar bit (unsupported)
  129. #define kMacApp_hasGrow        4    // bit 2 is grow bit
  130. #define kMacApp_hasZoom        8    // bit 3 is zoom bit (standard zoom bit)
  131.  
  132. // *****************************************************************************
  133. //    Structures
  134. // -----------------------------------------------------------------------------
  135.  
  136. typedef struct {
  137.     WStateData        wState;
  138.     unsigned char    closeToggle;
  139.     unsigned char    zoomToggle;
  140.     unsigned char    isHoriz;
  141.     unsigned char    ignoreHilite;
  142.     unsigned char    hasTitlebar;
  143. #ifdef ALLOW_GROW
  144.     unsigned char    hasGrow;
  145. #endif
  146. } WindoidData, *WindoidDataPtr, **WindoidDataHandle;
  147.  
  148. // -----------------------------------------------------------------------------
  149.  
  150. #define WindData (**(WindoidDataHandle)(window->dataHandle))
  151.  
  152.     // This macro is used so I can access the 'globals' easily. Note: the
  153.     // variable containing the window must be named 'window', and it must be in
  154.     // scope at the time of the usage of this macro.
  155.     // Also, they aren't REALLY globals, becuase they're kept for EACH window,
  156.     // which is why I use a bitfield, trying to keep this handle as small as
  157.     // possible.)
  158.  
  159. // *****************************************************************************
  160. #endif